package com.xiaoke.java1;

/**
 * @author yd
 * @version 1.0
 * @date 2022/3/1 23:52
 */
public class StringIntern1 {
    public static void main(String[] args) {
        //StringIntern.java中练习的拓展
        String s3 = new String("1") + new String("1");
        String  s4 = "11";//在字符串常量池中生成对象"11"
        String s5 = s3.intern();
        System.out.println(s3 == s4);//false
        System.out.println(s5 == s4);// true
    }
}
